package ru.rchervot.sanasar.client.view;

import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.HasHorizontalAlignment;
import com.google.gwt.user.client.ui.HasVerticalAlignment;
import com.google.gwt.user.client.ui.HorizontalPanel;

public abstract class AbstractModuleHeaderView extends Composite implements
	ModuleHeaderPresenter.Display {
	
	protected final HorizontalPanel leftPanel = new HorizontalPanel();
	protected final HorizontalPanel basePanel = new HorizontalPanel();
	
	private ModuleHeaderPresenter presenter;
	
	protected AbstractModuleHeaderView() {
		super();
		
		leftPanel.setStylePrimaryName("AbstractModuleHeaderView_Left");
		leftPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
		
		basePanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
		basePanel.add(leftPanel);
		basePanel.setCellHorizontalAlignment(leftPanel,
						HasHorizontalAlignment.ALIGN_LEFT);

		basePanel.setSize("100%", Constants.kModuleHeaderHeight + "px");
		
		this.initWidget(basePanel);
		this.setStylePrimaryName("AbstractModuleHeaderView");
	}
	
	@Override
	public void setPresenter(ModuleHeaderPresenter presenter) {
		this.presenter = presenter;
	}
	

}
